<?php
/**
 *Modelo de producto
 *@author Luis Gabriel Rodriguez <luisgabriel84@gmail.com>
 */
class Product extends AppModel {

	var $name = 'Product';
        /**
        * @var array Reglas de validacion
        * @access public
        */
	var $validate = array(
		'category_id' => array('numeric'),
		'nombre_empresa' => array('notempty'),
		'state_id' => array('numeric'),
		'city_id' => array('numeric'),
		'activo' => array('numeric')
	);
        /**
        * @var array
        * @access public
        */
        var $uses = array('Product','Banner');
        /**
        * @var array Mapeo relacional
        * @access public
        */
	var $belongsTo = array(
		'Category' => array(
			'className' => 'Category',
			'foreignKey' => 'category_id',
			'conditions' => '',
			'fields' => '',
			'order' => ''
		),
		'State' => array(
			'className' => 'State',
			'foreignKey' => 'state_id',
			'conditions' => '',
			'fields' => '',
			'order' => ''
		),
		'City' => array(
			'className' => 'City',
			'foreignKey' => 'city_id',
			'conditions' => '',
			'fields' => '',
			'order' => ''
		)
	);

	

}
?>